<?php
class NewsMenuForm extends Form
{
	function __construct()
	{				
		Form::Form('NewsMenuForm');
	}
	
	function draw()
	{
		global $display;
		
		$cat_newss 		= array();
		$news_cat_id 	= Url::get('news_catid','id',0);
		
		AZLib::getNewsCats();
		
		$display->add('news_cat_id',$news_cat_id);
		
		if(CGlobal::$allNewsCategories)
		{
			foreach (CGlobal::$allNewsCategories as $news_cat)
			{
				if($news_cat['public'])
				{
					$news_cat['url'] = URL::build('news_list',array('news_catid'=>$news_cat['id'],'azname'=>AZLib::safe_title($news_cat['name'])));
					
					$cat_newss[$news_cat['id']] = $news_cat;
				}
			}
		}
		
		$display->add('cat_newss',$cat_newss);
		$display->add('is_admin',User::have_permit(ADMIN_NEWS));
		$display->output("NewsMenu");
	}
}
?>